﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php
      $ma_hp=$_REQUEST["ma"];
	  $hknk=$_REQUEST["hk"];
	  $tam=mysql_query("select * from `hocki nienkhoa` where ma_hknk='$hknk' ");
	  $t=mysql_fetch_row($tam);
	  $hk=$t[1];$nk=$t[2];
	  $tam=mysql_query("select ten_hp from `hoc phan` where ma_hp='$ma_hp' ");
	  $t=mysql_fetch_row($tam);
	  $tenhp=$t[0];
	  $s=mysql_query("select sum(sisolop_hp) from `lop hoc phan` where ma_hp='$ma_hp' and ma_hknk='$hknk' ");
	  $s1=mysql_fetch_row($s);
	  $ss=$s1[0];
?>
<table align="center" width="850">
           <tr>
		       <td align="center">
	        
                   <span class="style6">
					KẾT QUẢ NHẬN XÉT MÔN HỌC <br />
					Học Phần: <?php echo $tenhp; ?><br />
					<input type="hidden" name="ma" value="<?php echo $ma_hp ?>" />
					
					
					<input type="hidden" name="hk" value="<?php echo $hknk; ?>;" />
					Tổng Số Sinh Viên: <?php echo $ss; ?>
					
					</span>
				</td>
		  </tr>
		  <tr><td height="20">&nbsp;</td></tr>
					<form id="f" name="f" method="post" action="">	
        <tr> <td valign="top" bordercolor="#FFFFFF">
    	
          <table width="850" align="center" cellspacing="0" border="1" bordercolor="#0066FF" cellpadding="0">
       		
      		
                            
      		<tr align="center" bordercolor="#FFFFFF" bgcolor="#CCCCCC">
            	<td width="413" height="40" class="bg"><span class="style7">Nội Dung Đánh Giá</span>				</td>
       	  	  	<td width="133" class="bg">
				          <span class="style7">Chưa Hài Lòng</span>				</td>
				<td width="112" class="bg">
				          <span class="style7">Hài Lòng</span>				</td>
				<td width="118" class="bg">
				          <span class="style7">Rất Hài Lòng</span>				</td>
				<td width="112" class="bg1">
				          <span class="style7">Xuất Sắc</span>				</td>
				
       	  	</tr>

		   <?php
		           
					
					    $sql=mysql_query("select a.ma_tc,a.noidung_tc from `tieu chi` a, `tieuchi hocki` b where a.ma_tc=b.ma_tc and b.ma_hknk='$hknk' ");
						
						while($row=mysql_fetch_row($sql))
						{
						   $matc=$row[0];
						   $noidung=$row[1];
						   $sql1=mysql_query("select ma_tc,`muc danh gia`,count(*) from `danh gia` where  ma_hp='$ma_hp' and ma_hknk='$hknk' and ma_tc='$matc' and `muc danh gia`='1' group by `muc danh gia`,ma_tc");
						   $sql2=mysql_query("select ma_tc,`muc danh gia`,count(*) from `danh gia` where  ma_hp='$ma_hp' and ma_hknk='$hknk' and ma_tc='$matc' and `muc danh gia`='2' group by `muc danh gia`,ma_tc");
						   $sql3=mysql_query("select ma_tc,`muc danh gia`,count(*) from `danh gia` where  ma_hp='$ma_hp' and ma_hknk='$hknk' and ma_tc='$matc' and `muc danh gia`='3' group by `muc danh gia`,ma_tc");
						   $sql4=mysql_query("select ma_tc,`muc danh gia`,count(*) from `danh gia` where  ma_hp='$ma_hp' and ma_hknk='$hknk' and ma_tc='$matc' and `muc danh gia`='4' group by `muc danh gia`,ma_tc");
						   if(mysql_num_rows($sql1)==0) $muc1=0;
						   else
						   {
						   $r1=mysql_fetch_row($sql1);
						   $muc1=$r1[2];
						   }
						   if(mysql_num_rows($sql2)==0) $muc2=0;
						   else
						   {
						   $r2=mysql_fetch_row($sql2);
						   $muc2=$r2[2];
						   }
						   if(mysql_num_rows($sql3)==0) $muc3=0;
						   else
						   {
						   $r3=mysql_fetch_row($sql3);
						   $muc3=$r3[2];
						   }
						   if(mysql_num_rows($sql4)==0) $muc4=0;
						   else
						   {
						   $r4=mysql_fetch_row($sql4);
						   $muc4=$r4[2];
						   }
						   ?>
						   <tr bordercolor="#FFFFFF">
						       <td class="bg" height="50" style="font-size:18px;">
							         <?php echo "&nbsp;&nbsp; $matc. $noidung"; ?> 
							   </td>
					
							   <td class="bg" align="center">
							        <?php 
										  echo "$muc1 &nbsp;&nbsp; SV";
										  
									?>
							   </td>
							   <td class="bg" align="center">
							        <?php
									       
										  echo "$muc2 &nbsp;&nbsp; SV";
									?>
							   </td>
							   <td class="bg" align="center">
							         <?php
									      
										   echo "$muc3 &nbsp;&nbsp; SV";
									 ?>
							   </td>
							   <td class="bg1" align="center">
							          <?php
									       echo "$muc4 &nbsp;&nbsp; SV";
										   
									?>
							   </td> 
							     
                           </tr>
						   <?php
						      
						}//while
						 
					 
		   ?>
		   
	 <tr bordercolor="#FFFFFF">
		    <td  colspan="5">
				<table width="100%">
				        
						 <tr><td height="20">&nbsp;</td></tr>
						
						 <tr>
							 <td  style="font-size:20px; font-weight:bold; color:#000099;">
							 * Ý Kiến Khác:
							 </td>
							 
						 </tr>
						 <tr>
						      <td style="font-size:18px; font-weight:bold">
							      <?php
								      $t=mysql_query("select ghi_chu from hoc where ma_hknk='$hknk' and ma_hp='$ma_hp'"); 
									   while ($t1=mysql_fetch_row($t))
									  {	  $t2=$t1[0];
										  if($t2=="") echo "";
										  else
										      echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $t2<br/>";
									  }
								  ?>
							  </td>
							  
						 </tr>
						 
						 <tr><td height="20">&nbsp;</td></tr>
						 
						<tr >
									<td width="98%" ><label><div align="center">
												 <table cellpadding="0" cellspacing="0" border="0" width="200" height="40" style="border:1px solid #CCCCCC" bgcolor="#CCCCCC" >
													   <tr >
															 <td  class="style7">
															 <a class="mo" href="<?php echo "cnk-inhp.php?ma=$ma_hp&&hk=$hknk";?>">In Kết Quả Đánh Giá</a>
															 </td>
													   </tr>
												 </table>
													 </div></label></td>
									
						</tr> 
						
						<tr><td height="20">&nbsp;</td></tr>
						
						</table>
					</td> 
			 </tr>
					  
		       </table>
		  </td>
    </tr>
    
</form>
</table>
</body>
</html>
